<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>UserPublish 组件测试</title>
    <style>
        body {
            margin: 0;
            padding: 20px;
            background: linear-gradient(135deg, #1e1e2e, #2d2d44);
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            min-height: 100vh;
        }
        
        .test-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
        }
        
        .test-header {
            text-align: center;
            color: white;
            margin-bottom: 40px;
        }
        
        .test-button {
            display: block;
            margin: 20px auto;
            padding: 12px 24px;
            background: linear-gradient(135deg, #60a5fa, #3b82f6);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            cursor: pointer;
            transition: transform 0.2s ease;
        }
        
        .test-button:hover {
            transform: translateY(-2px);
        }
    </style>
    <!-- 引入 Shoelace 样式 -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.15.0/cdn/themes/light.css" />
    <script type="module" src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.15.0/cdn/shoelace-autoloader.js"></script>
</head>
<body>
    <div class="test-container">
        <div class="test-header">
            <h1>UserPublish 组件测试</h1>
            <p>点击下方按钮测试修复后的发布组件</p>
        </div>
        
        <button class="test-button" onclick="openPublishModal()">
            打开发布弹窗
        </button>
        
        <!-- UserPublish 组件 -->
        <user-publish id="userPublish"></user-publish>
    </div>

    <script type="module">
        // 模拟导入组件
        import('./Share-Top-client/src/components/index/UserPublish/index.js');
        
        // 全局函数
        window.openPublishModal = function() {
            const userPublish = document.getElementById('userPublish');
            if (userPublish && userPublish.open) {
                userPublish.open();
            }
        };
    </script>
</body>
</html>